import request from '@/utils/request'

// 查询额外字段配置分页列表
export function page(query) {
  return request({
    url: '/v1/GET/addition/field/page',
    method: 'get',
    params: query
  })
}

// 获取额外字段配置详情
export function getElementAdditionField(id) {
  return request({
    url: '/v1/GET/addition/field/' + id,
    method: 'get'
  })
}

// 新增单个额外字段配置
export function insertElementAdditionField(data) {
  return request({
    url: '/v1/POST/addition/field',
    method: 'post',
    data: data
  })
}

// 修改单个额外字段配置
export function updateElementAdditionField(data) {
  return request({
    url: '/v1/PUT/addition/field',
    method: 'put',
    data: data
  })
}
// 初始化配置数据到缓存
export function initCache() {
  return request({
    url: '/v1/POST/addition/field/cache',
    method: 'POST',
  })
}
// 删除单个或多个额外字段配置
export function delElementAdditionField(ids) {
  return request({
    url: '/v1/DELETE/addition/field/' + ids,
    method: 'delete'
  })
}
